vcProcessExecutor

Process executor is a behavior that holds and runs process routines.

See in: Overview

Module: vcProcessModel

Parent: vcBehavior

Children -

Referenced by: vcTransportNode.ProcessExecutor

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
CurrentStatementvcStatementRGets the statement currently being executed by the process executor.
ProcessesvcList[vcRoutine]RGets all process routines in this executor.
See more
Exceptions:
RuntimeError: When the executor does not have a program. This can occur if called too early during layout/component loading.
TransportNodevcTransportNodeRWGets or sets the associated transport node that this executor's processes use to receive and send product instances.

Parameters:
node (vcTransportNode): Sets the associated transport node.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
createProcessvcProcessRoutineString nameCreates a new process routine and adds it to this process executor's processes.
See more
Parameters:
name (String): The process name has to be unique within this process executor's processes.

Returns:
vcProcessRoutine: The newly created process routine.

Exceptions:
RuntimeError: When the executor doesn't have a program. This can occur if called too early during layout/component loading.
ValueError: When given process name is empty or not unique.

Example: Access Process Statements

"""Read the process statements of a routine in Process Editor found via process executor behavior."""
import vcCore as vc

comp = vc.getComponent()
exec = comp.findBehavior("ProcessExecutor") # vcProcessExecutor

routine = exec.Processes[0] # vcRoutine that inherits from vcScope
print (routine.Statements) # access the statements of the routine

Example: Create New Process Statement

""" Creates a new process statement and sets the property values."""

import vcCore as vc
import vcExecutor as vc_ex

comp = vc.getComponent()
exec = comp.findBehavior("ProcessExecutor") # vcProcessExecutor

routine = exec.Processes[0] # vcRoutine that inherits from vcScope
new_statement = routine.createStatement(vc_ex.vcStatementType.PROCESS_SET_PROPERTY) # createStatement from vcScope
new_statement.TargetProperty = "x"
new_statement.ValueExpression.Value = "y" # set the value of vcExpressionProperty

Example: Delete Process Statement

""" Deletes a process statement."""

import vcCore as vc

comp = vc.getComponent()
exec = comp.findBehavior("ProcessExecutor") # vcProcessExecutor

routine = exec.Processes[0] # vcRoutine that inherits from vcScope
statement = routine.Statements[0] # take the first statement of the routine
statement.delete()